﻿using System;
using System.Web.Mvc;
using Redmine.Core.Entities;
using Redmine.Core.Repositories;
using Redmine.Core.UnitOfWork;
using UnitOfWork;

namespace Redmine.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";
            var dabase = new MyDatabaseFactory();
            ISettingRepository repository = new SettingRepository(dabase);
            IUnitOfWork unitOfWork = new MyUnitOfWork(dabase);
            repository.Add(new Setting() { Name = "aa", Value = "ss", UpdateOn = DateTime.Now });
            repository.Add(new Setting() { Name = "aa", Value = "ss", UpdateOn = DateTime.Now });
            unitOfWork.Commit();
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
